import React from 'react'
import { Outlet, useLocation, useNavigate } from 'react-router-dom'

export default function Home() {
  const navigate = useNavigate();


  const toMusicHandle = () => {
    navigate("/main/home/music/?user=李沛华&id=001",{
      state:[
        {id:'001',name : '月色2'},
        {id:'002',name : '月色22'},
        {id:'003',name : '月色222'},
        {id:'004',name : '月色2222'},
        {id:'005',name : '月色22222'}
      ]
    })
  }

  const toNewsHandle = () => {
    navigate("/main/home/news/?user=李沛华&id=001",{
      state:[
        {id:'001',name : '月色2'},
        {id:'002',name : '月色22'},
        {id:'003',name : '月色222'},
        {id:'004',name : '月色2222'},
        {id:'005',name : '月色22222'}
      ]
    })
  }
  return (
    <div>
      <h3>我是Home的内容</h3>
      <button onClick={toMusicHandle}>Music</button>
      <button onClick={toNewsHandle}>News</button>
      <Outlet />
    </div>
  )
}
